import search from "@/page/index/search";
import {searchSpan} from "@/api/span";

export const optionParent = {
  calcHeight: 95,
  tip: false,
  searchShow: false,
  searchMenuSpan: searchSpan(1),
  border: true,
  index: true,
  viewBtn: false,
  menuWidth: 150,
  dialogWidth: 880,
  dialogClickModal: false,
  selection:true,
  addBtn: false,
  delBtn:false,
  editBtn:false,
  // menu:false,
  column: [
    {
      label: '库区编码',
      prop: 'areaCode',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '库区名称',
      prop: 'areaName',
      search:true,
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '库区类型',
      prop: 'areaType',
      type: "select",
      filterable:true,
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
      dicUrl: "/api/blade-system/dict-biz/dictionary?code=areaType",
      props: {
        label: "dictValue",
        value: "dictKey"
      },
    },
    {
      label:"是否启用FIFO",
      prop:'isFifo',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: false,
      dicData: [{
        label:'是',
        value:1
      },
        {
          label:"否",
          value:0,
        }]
    },
    {
      label: '有效',
      prop: 'isEnable',
      type: "select",
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
      value:true,
      dicData: [
        {
          label: "是",
          value: true
        },
        {
          label: "否",
          value: false
        }
      ],
    },
    {
      label:'备注',
      prop:'remark',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '创建人员',
      prop: 'createUserName',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    },
    {
      label: '创建时间',
      prop: 'createTime',
      addDisplay: false,
      editDisplay: false,
      viewDisplay:false,
    }
  ],
  group:[{
    label:"库区信息",
    column: [
      {
        label: '库区编码',
        prop: 'areaCode',
        maxlength:20,
        showWordLimit:true,
        rules:[{
          required:true,
          message:"请输入库区编码",
          trigger:"blur"
        }]
      },
      {
        label: '库区名称',
        prop: 'areaName',
        maxlength:20,
        showWordLimit:true,
        rules:[{
          required:true,
          message:"请输入库区名称",
          trigger:"blur"
        }]
      },
      {
        label: '库区类型',
        prop: 'areaType',
        type: "select",
        filterable:true,
        rules:[{
          required:true,
          message:"请选择库区类型",
          trigger:"blur"
        }],
        dicUrl: "/api/blade-system/dict-biz/dictionary?code=areaType",
        props: {
          label: "dictValue",
          value: "dictKey"
        },
      },
      {
        label:"启用FIFO",
        prop:'isFifo',
        type:'select',
        value:1,
        rules:[
          {
            required: true,
          }
        ],
        dicData: [{
          label:'是',
          value:1
        },
          {
            label:"否",
            value:0,
          }]
      },

      {
        label: '有效',
        prop: 'isEnable',
        type: "select",
        rules:[{
          required:true,
          message:"请选择是否有效",
          trigger:"blur"
        }],
        value:true,
        dicData: [
          {
            label: "是",
            value: true
          },
          {
            label: "否",
            value: false
          }
        ],
      },
      {
        label:'备注',
        prop:'remark',
        type: "textarea",
        maxlength: 60,
        minRows:3,
        showWordLimit: true,
        span:24,
      },
      {
        label: '创建人员',
        prop: 'createUserName',
        addDisplay: false,
        editDisplay:false,
      },
      {
        label: '创建时间',
        prop: 'createTime',
        addDisplay: false,
        editDisplay:false,
      },
      {
        title: '',
        component: 'el-divider',
        span: 24,
        labelWidth: '0px',
        params: {
          contentPosition: 'left'
        },
      },
    ],
  }]
};

export const optionChild = {
  calcHeight: 95,
  tip: false,
  searchShow: true,
  searchMenuSpan: searchSpan(1),
  tree: true,
  border: true,
  index: true,
  viewBtn: true,
  menuWidth: 220,
  dialogWidth: 880,
  dialogClickModal: false,
  menu:false,
  addBtn:false,
  column: [
    {
      label:'库位编码',
      prop:'locCode'
    },
    {
      label:'库位名称',
      prop:'locName'
    },
    {
      label:'是否预留',
      prop:'reserve',
      type: "select",
      value:true,
      dicData: [
        {
          label: "是",
          value: true
        },
        {
          label: "否",
          value: false
        }
      ],
    },
    {
      label:'有效',
      prop:'isEnable',
      type: "select",
      value:true,
      dicData: [
        {
          label: "是",
          value: true
        },
        {
          label: "否",
          value: false
        }
      ],
    },
  ]
};
